.\" Copyright (c) 2008 Hypertriton, Inc. <http://hypertriton.com/>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd July 25, 2008
.Dt VG_POLYGON 3
.Os
.ds vT Agar API Reference
.ds oS Agar 1.3
.Sh NAME
.Nm VG_Polygon
.Nd agar-vg polygon entity
.Sh SYNOPSIS
.Bd -literal
#include <agar/core.h>
#include <agar/gui.h>
#include <agar/vg.h>
.Ed
.Sh DESCRIPTION
.\" IMAGE(http://libagar.org/widgets/VG_Polygon.png, "A VG_Polygon")
.Nm
is a
.Xr VG 3
node class which describes a filled polygon with
.Xr VG_Point 3
entities as its vertices.
.Sh INTERFACE
.nr nS 1
.Ft "VG_Polygon *"
.Fn VG_PolygonNew "VG_Node *parent"
.Pp
.Ft "Uint"
.Fn VG_PolygonVertex "VG_Polygon *P" "VG_Point *pt"
.Pp
.Ft "void"
.Fn VG_PolygonDelVertex "VG_Polygon *P" "Uint vtx"
.Pp
.nr nS 0
The
.Fn VG_PolygonNew
function creates a new polygon entity attached to
.Fa parent ,
without any vertices.
.Pp
.Fn VG_PolygonVertex
creates a new vertex using the existing
.Xr VG_Point 3
.Fa pt .
The index of the new vertex is returned.
.Pp
.Fn VG_PolygonDelVertex
removes the specified vertex
.Fa vtx
from the polygon.
The function is a no-op if
.Fa vtx
is an invalid index.
.Pp
.Fn VG_PolygonSetOutline
disables filling of the polygon such that only its outline is displayed.
Default behavior is to display a filled polygon.
.Sh SEE ALSO
.Xr VG 3 ,
.Xr VG_Point 3
.Sh HISTORY
The
.Nm
class first appeared in Agar 1.3.3.
